package com.jinxin.platform.cdcardpassmgr.controller;

import com.jinxin.platform.base.common.pojo.JsonResult;
import com.jinxin.platform.cdcardpassmgr.bean.CdvehicleopersysOrgCorres;
import com.jinxin.platform.cdcardpassmgr.rpc.CdcardpassmgrRpc;
import com.jinxin.platform.cdcardpassmgr.service.ICdvehicleopersysOrgCorresService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2021-09-24
 * @Author: Lingnan
 **/
@RestController
@RequestMapping("/cdvehicleopersysGps")
@Slf4j
public class CdvehicleopersysGpsController {
    @Autowired
    private CdcardpassmgrRpc cdvehicleopersysRpc;
    @Autowired
    private ICdvehicleopersysOrgCorresService orgCorresService;

    @GetMapping("/listManagedUserList")
    public JsonResult listManagedUserList(){
        return cdvehicleopersysRpc.listManagedUserList();
    }

    @GetMapping("/listOrgList")
    public JsonResult listOrgList(){
        return cdvehicleopersysRpc.getOrgWithCondition();
    }

    @PostMapping("/saveOrgRelation")
    public JsonResult saveOrgRelation(@RequestBody CdvehicleopersysOrgCorres record){
        return orgCorresService.saveOrUpdate(record);
    }

    @GetMapping("/doGet")
    public Object doGet(String url,String jsonStr){
        return cdvehicleopersysRpc.doRequest("get",url,jsonStr);
    }

    @PostMapping("/doPost")
    public Object doPost(String url,String jsonStr){
        return cdvehicleopersysRpc.doRequest("post",url,jsonStr);
    }

    @GetMapping("/loginForGps")
    public Object loginForGps(){
        return cdvehicleopersysRpc.loginForGps();
    }

    @RequestMapping("/getStaOverview")
    public JsonResult getStaOverview(){
        return cdvehicleopersysRpc.getStaOverview();
    }


}
